from pysmirk import *
from milsymb import *


def test1():
    # Create a xml  document
    a = KMLDocument('testIconStyle')
    
    # Create an infantry style
    ms = MilSym()
    stl = KMLStyle('mech_icon')
    stl.SetStyle( KMLIconStyle(ms.Get('friendly','land1','077') ))
    stl.SetStyle( KMLLabelStyle('ffff0000') )
    a.AddStyle( stl )
    
    # Company Folder
    coy = KMLFolder('A Coy')
    a.AddItem( coy )
    # Create a Placemark
    lon = -63.5390
    for i in 'ABC':
        x = KMLIconPlacemark('%s Plt'%(i), 44.6805, lon, 20, 'mech_icon')
        x.SetExtrude()
        x.SetDescription('STATUS: GREEN<hr>SUPPLY: GREEN')
        coy.AddItem( x )
        lon += 0.001
    
    a.WriteXML()
    
test1()
